var viewStatusModel = new function () {
    this.StatusId = ko.observable(data.LeadStatusInfo.StatusId);
    this.Title = ko.observable(data.LeadStatusInfo.Title).extend({ required: { message: "Tiêu đề là yêu cầu"} });
    this.Color = ko.observable(data.LeadStatusInfo.Color);
    this.MilestoneId = ko.observable(data.LeadStatusInfo.MilestoneId);
    this.OcdMilestoneId = ko.observable(data.LeadStatusInfo.MilestoneId);
    this.MilestoneOptions = ko.observableArray(data.MilestoneList);
    this.Submit = function () {
        if (viewStatusModel.errors().length == 0) {
            $('form').submit();
        }
        this.errors.showAllMessages();
    }
}

viewStatusModel.errors = ko.validation.group(viewStatusModel);
ko.validation.rules.pattern.message = 'Invalid.';
ko.applyBindings(viewStatusModel, document.getElementById("main"));